package lab02.Test21;

/**
 * Created by lady on 2017/10/31.
 */
public class Test01 {
    public static void main(String[] args) {
       //行为：一个字符串中给定字符出现的频率
        String sentence = "hello,world!";
        int j=0;

        //遍历数组的每个元素
        for(int i=0;i<sentence.length();i++)
        {
            String getstr=sentence.substring(i,i+1);
            if(getstr.equals("o"))
            {
                j++;
            }
        }
        System.out.print("o:"+j);
    }
    }